﻿@model List<CMP.ERP.Model.CommodityType>
@{
    Layout = null;
}
@Html.Action("Account_Show", "Account");
    <div class="content">
        <div class="right" id="mainFrame">
    <div class="header">
        <div class="header-right">
          
            <ul id="large-menu" class="nav nav-list collapse">
                <li><a href="/Stock/Stock_Show">库存信息</a></li>
            </ul>
            <form method="post" action="/Brand/AddCommodityTypeDo">
                <div id="modal-container-973559" class="modal hide fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="width:400px; margin-left:-150px;">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="myModalLabel">
                            商品类型新增系统
                        </h3>
                    </div>
                    <div class="modal-body">
                        <table class="table table-hover table-bordered " style="width:400px;text-align:center;margin:0 auto;border:2px solid #428bca;">
                            <tbody>
                                <tr>
                                    <td>品牌名称:</td>
                                    <td><input type="text" name="CommodityType_Name" required /></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="modal-footer">
                        <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button> <button type="submit" class="btn btn-default"><span class="icon-inbox"></span>保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!-- 顶部 -->
    <div id="middle">
        <div class="Switch"></div>
        <script type="text/javascript">
            $(document).ready(function (e) {
                $(".Switch").click(function () {
                    $(".left").toggle();

                });
            });
        </script>
        <div class="right" id="mainFrame">
            <div class="right_cont">
                <ul class="breadcrumb">
                    当前位置：
                    <a href="/Home/Index">首页</a>
                    <span class="divider">/</span>
                    商品类型
                </ul>
                <div class="title_right"><strong>商品类型管理</strong></div>
                <div style="width:100%; margin:auto">
                    <div>
                        <button id="modal-973559" href="#modal-container-973559" role="button" type="button" class="btn btn-default" data-toggle="modal"><span class="icon-plus"></span>新增品牌</button>
                    </div>
                    <div style="margin-top:20px;">
                        <table class="table  table-hover table-bordered table-striped">
                            <thead>
                                <tr>
                                    <th>品牌编号</th>
                                    <th>品牌名称</th>
                                    <th>该品牌下的商品种类数</th>
                                    <th>详情</th>
                                    <th>编辑</th>
                                    <th>删除</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach (var item in Model)
                                {
                                    <tr>
                                        <th>@item.CommodityType_Id</th>
                                        <th>@item.CommodityType_Name</th>
                                        <th>@item.num</th>
                                        <th>
                                                    @if (@item.num > 0)
                                            {
                                                <a href="/Brand/Xiangqing/@item.CommodityType_Id">详情</a>
                                            }
                                            else
                                            {
                                                <p>该品牌下无商品</p>
                                            }
                                        </th>
                                        <th>
                                            <a href="/Brand/Edit/@item.CommodityType_Id" style="color:black"><span class="icon-edit"></span>更新</a>
                                           
                                            </th>
                                        <th>
                                                    @if (@item.num > 0)
                                            {
                                                <span>（有商品，无法删除）</span>
                                            }
                                            else
                                            {
                                                <a href="/Brand/DelCommodityTypeDo/@item.CommodityType_Id" style="color:black" onclick="return confirm('真的要删除吗？')"><span class="icon-remove"></span>删除</a>
                                            }
                                        </th>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
        </div>
    </div>
 

